//
//  DISAorderTableViewCell.m
//  Distributor
//
//  Created by 主事丫环 on 2019/5/14.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "DISAorderTableViewCell.h"

@implementation DISAorderTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.bgview.backgroundColor = [UIColor whiteColor];
    self.bgview.layer.borderWidth = 1;
    self.bgview.layer.borderColor = [UIColor colorWithHexString:@"#E1E1E1"].CGColor;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}
-(void)refashwithmodel:(DISAorderlistModel *)model{
//    @property (nonatomic, copy) NSString *address;
//    @property (nonatomic, copy) NSString *agent_id;
//    @property (nonatomic, copy) NSString *parts_details;
//    @property (nonatomic, copy) NSString *image_url;
//    @property (nonatomic, copy) NSString *parts_name;
//    @property (nonatomic, copy) NSString *Id;
//    @property (nonatomic, copy) NSString *parts_count;
//    @property (nonatomic, copy) NSString *create_time;
//    @property (nonatomic, copy) NSString *parts_id;
//    @property (nonatomic, copy) NSString *state;
    self.timeLB.text = [NSString stringWithFormat:@"%@",model.create_time];
    self.titlLB.text = [NSString stringWithFormat:@"%@",model.parts_details];
    self.numberLLB.text = [NSString stringWithFormat:@"%@个",model.parts_count];
    self.stateBut.hidden = YES;
    
    if ([model.image_url hasPrefix:@"http"]) {
        [self.myimage sd_setImageWithURL:[NSURL URLWithString:model.image_url] placeholderImage:defaultImg];
    }else{
        sdimg(self.myimage, model.image_url);
        
    }
    if ([model.state integerValue] == 1) {
        self.stateBut.hidden = NO;
        [self.stateBut setTitle:@"已取消" forState:(UIControlStateNormal)];
    }
    
  
    
}

- (IBAction)stataaction:(UIButton *)sender {
  
    if (self.myblock) {
        self.myblock(@"");
    }
}

@end
